<template>
  <div>
    <PageTools>
      <el-button type="primary" size="mini">添加权限</el-button>
    </PageTools>
    <div style="padding: 20px">
      <el-table :data="permList" row-key="id">
        <el-table-column label="名称" align="center" prop="name" />
        <el-table-column label="标识" align="center" prop="code" />
        <el-table-column label="描述" align="center" prop="description" />
        <el-table-column label="操作" align="center">
          <template>
            <el-button type="text">添加</el-button>
            <el-button type="text">编辑</el-button>
            <el-button type="text">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
import { getPermissionList } from '@/api/permisson'
import { tranListToTreeData } from '@/utils'
export default {
  data() {
    return {
      permList: []
    }
  },
  created() {
    this.getPermissionList()
  },
  methods: {
    async getPermissionList() {
      const res = await getPermissionList()
      console.log(res)
      this.permList = tranListToTreeData(res, '0')
    }
  }
}
</script>
<style scoped lang='scss'>
</style>

